<?php 

$sql = "SELECT * FROM fix_main_products_type";
$rsd = mysql_query($sql);
$selected = "";
$main_id = "";
$default_main = "";
if(isset($_GET['main_id'])) 	
	$main_id = $_GET['main_id'];
while($row = mysql_fetch_array($rsd)){
	
	if($default_main  == "")
		$default_main  = $row['fix_main_products_type_id'];
	
	if($row['fix_main_products_type_id'] == $main_id)
		$selected = "selected=\"selected\"";
	else $selected = "";
	echo "<option value=\"".$row['fix_main_products_type_id']."\" $selected>".$row['fix_main_products_type_name']."</option>";
}
?>